tp=unique(cells(:,1));
ident=unique(cells(:,5));
res=[];
for gnd=1:length(tp)
    for knd=1:length(ident)
        res(knd,gnd)=sum(cells(:,5)==ident(knd)&cells(:,1)==tp(gnd));
    end
end

tp=unique(cells(:,1));
cells_sort={};
for gnd=1:length(tp)
    for knd=1:15
        cells_sort{gnd,knd}=cells(cells(:,5)==knd&cells(:,1)==tp(gnd),2:3);
    end
end

ind_cells=cells;
res=[];
for hnd=1:size(ind_cells,1)
    cur_cell=ind_cells(hnd,2);
    pl=ind_cells(hnd,3);
    if pl==2
        cur_cell=cur_cell+size(proj_meta(cur_site).raw_data(1,1).smoothed_ROIs,2);
    elseif pl==3
        cur_cell=cur_cell+size(proj_meta(cur_site).raw_data(1,1).smoothed_ROIs,2)+size(proj_meta(cur_site).raw_data(2,1).smoothed_ROIs,2);
    elseif pl==4
        cur_cell=cur_cell+size(proj_meta(cur_site).raw_data(1,1).smoothed_ROIs,2)+size(proj_meta(cur_site).raw_data(2,1).smoothed_ROIs,2)...
            +size(proj_meta(cur_site).raw_data(3,1).smoothed_ROIs,2);
    end
    res(hnd)=cur_cell;
end
all_res=res;
res=unique(res);
dupl=[];
cnt=1;
for ynd=1:length(res)
    if sum(ismember(all_res,res(ynd)))>1
        dupl(cnt,1)=res(ynd);
        dupl(cnt,2)=sum(ismember(all_res,res(ynd)));
        cnt=cnt+1;
    end
end